{__NOLAYOUT__}
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="__PUBLIC__/bbs/static/common/js/layui/css/layui.css">
  <link rel="stylesheet" href="__PUBLIC__/bbs/static/default/css/global.css">
  <link rel="stylesheet" href="__PUBLIC__/bbs/static/default/css/index.css">
  <link rel="stylesheet" href="__PUBLIC__/bbs/static/common/js/editor/css/simditor.css" />
  <meta charset="UTF-8">
  <title>社区-{$seo_title}</title>
  <include file="Index:meta" />
  <style>
        #page{text-align: center;margin-top: 20px;margin-bottom: 20px;}
        #page .a1{display: none;}
        #page a{color: #2AABED;width: 20px;height: 20px;padding: 10px;}
        #page span{width: 20px;height: 20px;padding: 10px;}
        #page .first{display: none;}
        #page .last{display: none;}
    </style>
    <if condition="($p eq '') OR ($p eq 1)">
        <style>#page .previous{display: none;}</style>
    </if>
</head>
<include file="Index:header" />
<body style="margin-top:0px">
  <div class="layui-container fly-marginTop">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md8 content detail">
        <div class="fly-panel detail-box">
          <h1>{$tips_info.title}</h1>
          <div class="fly-detail-info">
            <div class="fly-admin-box">
               <if condition="$tips_info['is_top'] eq 1">
                    <span class="layui-badge layui-bg-black">置顶</span>
                </if>
                <if condition="$tips_info['is_re'] eq 1">
                    <span class="layui-badge">精帖</span>
                </if>　
            </div>
            <span class="fly-list-nums">
              <a href="#comment">
                <i class="iconfont" title="评论">&#xe60c;</i></a>{$tips_info.posts}
            </span>
          </div>
          <div class="detail-about">
            <a class="fly-avatar" href="{:U('Home/Bbs/center',array('uid'=>$tips_info['uid'],'type'=>$tips_info['type']))}">
              <img <if condition="$tips_info['img'] eq ''">src="__PUBLIC__/bbs/uploads/avatar/default_middle.png"<else/>src="{$tips_info.img}"</if> alt="{$tips_info.username}">
            </a>
            <div class="fly-detail-user">
              <a href="{:U('Home/Bbs/center',array('uid'=>$tips_info['uid'],'type'=>$tips_info['type']))}" class="fly-link">
                <cite>{$tips_info.username}</cite>
              </a>
            </div>
              <span>发表于{$tips_info.time|toDate}</span>
            </div>
            <div class="detail-body photos">
                {$tips_info.content}
              </div>
          <if condition="($ms eq 1) OR ($uid eq $tips_info['uid'])">
          <!-- <span type="edit">
            <a href="{:U('Home/Bbs/add',array('id'=>$tips_info['id']))}" class="layui-btn layui-btn-primary layui-btn-sm">编辑</a>
          </span> -->
          <span type="del">
            <a href="{:U('Home/Bbs/del_tips',array('id'=>$tips_info['id']))}" class="layui-btn layui-btn-primary layui-btn-sm">删除</a>
          </span>
          </if>
          <if condition="$ms eq 1">
          <if condition="$tips_info['is_top'] neq 1">
          <hr>
          <a href="{:U('Home/Bbs/top',array('id'=>$tips_info['id']))}"><span class="layui-btn layui-btn-primary layui-btn-sm action">置顶</span></a>
          <else/>
          <a href="{:U('Home/Bbs/top',array('id'=>$tips_info['id']))}"><span class="layui-btn layui-btn-primary layui-btn-sm action">取消置顶</span></a>
          </if>
          <if condition="$tips_info['is_re'] neq 1">
          <a href="{:U('Home/Bbs/re',array('id'=>$tips_info['id']))}"><span  class="layui-btn layui-btn-primary layui-btn-sm action">精华</span></a>
          <else/>
          <a href="{:U('Home/Bbs/re',array('id'=>$tips_info['id']))}"><span  class="layui-btn layui-btn-primary layui-btn-sm action">取消精华</span></a>
          </if>
           </if>
        </div>

        <div class="fly-panel detail-box" id="flyReply">
          <fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
            <legend>回帖</legend>
          </fieldset>
          <ul class="jieda" id="jieda">
              <foreach name="tips_com" item="v">
              <li data-id="111" class="jieda-daan">
                <a name="item-1111111111"></a>
                <div class="detail-about detail-about-reply">
                  <div class="fly-detail-user">
                    <a href="{:U('Home/Bbs/center',array('uid'=>$v['uid'],'type'=>$v['type']))}" class="fly-link">
                        <img style="width:50px;height:50px;" <if condition="$v['img'] eq ''">src="__PUBLIC__/bbs/uploads/avatar/default_middle.png"<else/>src="{$v.img}"</if> alt="{$v.username}">
                      <cite>{$v.username}</cite>
                    </a>
                    <if condition="$v['uid'] eq $tips_info['uid']">
                    <span>(楼主)</span>
                    </if>
                  </div>
                <div class="detail-body jieda-body photos">
                    <p>{$v.content}</p>
                </div>
                <div class="jieda-reply">
                <span>发表于{$v.time|toDate}</span>
                <if condition="($v['uid'] eq $tips_info['uid']) AND ($v['username'] eq $tips_info['username']) OR $ms eq 1">
                  <div class="jieda-admin">
                    <!-- <span type="edit">
                      <a href="{:U('Home/Bbs/edit',array('id'=>$v['id']))}">编辑</a>
                    </span> -->
                    <span type="del">
                      <a href="{:U('Home/Bbs/del_com',array('id'=>$v['id'],'tid'=>$v['tid']))}">删除</a>
                    </span>
                  </div>
                </div>
                </if>
              </li>
            </foreach>
            </ul>
            <div id="page">{$page}</div>
            
          <div class="layui-form layui-form-pane" <if condition="$uid eq ''">style="display:none;"</if>>
            <form action="{:U('Home/Bbs/addcom')}" method="post" id="com">
                <input type="hidden" name="tid" value="{$tips_info.id}">
              <div class="layui-form-item layui-form-text">
                <a name="comment"></a>
                <div class="layui-input-block">
                  <textarea id="editor" name="content"  placeholder="请输入内容" class="layui-textarea fly-editor" lay-verify="required"></textarea>
                </div>
              </div>
              <div class="layui-form-item">
                <button class="layui-btn submit">提交回复</button>
              </div>
            </form>
          </div>
        </div>
      </div>
      <div class="layui-col-md4">
        <dl class="fly-panel fly-list-one">
          <dt class="fly-panel-title">热门</dt>
          <foreach name="hot" item="h">
                <dd>
                    <a href="{:U('Home/Bbs/show',array('id'=>$h['id']))}" style="color:#2AABED">{$h.title}</a>
                    <i class="iconfont icon-pinglun1" style="color:#CDCDCD">{$h.posts}</i>
                </dd>
            </foreach>
        </dl>

      </div>
    </div>
  </div>
  <!--JS引用-->
  <script src="__PUBLIC__/bbs/static/common/js/jquery.min.js"></script>
  <script src="__PUBLIC__/bbs/static/common/js/layui/layui.all.js"></script>
  <script src="__PUBLIC__/bbs/static/common/js/global.js"></script>

  <script type="text/javascript" src="__PUBLIC__/bbs/static/common/js/editor/js/module.js"></script>
  <script type="text/javascript" src="__PUBLIC__/bbs/static/common/js/editor/js/hotkeys.js"></script>
  <script type="text/javascript" src="__PUBLIC__/bbs/static/common/js/editor/js/uploader.js"></script>
  <script type="text/javascript" src="__PUBLIC__/bbs/static/common/js/editor/js/simditor.js"></script>
  <script type="text/javascript">
    $(function () {
      var editor = new Simditor({
        textarea: $('#editor'),
        toolbar: ['title', 'bold', 'italic', 'underline', 'strikethrough', 'color', '|', 'ol', 'ul', 'code', 'indent', 'outdent', '|', 'link', 'image', 'hr'],
        upload: {
          url: '/api.php/upload/attach.html',
          params: { attach: $("input[name='attach']").val() },
          fileKey: 'file',
          connectionCount: 3,
          leaveConfirm: '正在上传文件',
        }
      });
    });
    $('.submit').on('click',function(){
      var con = $('#editor').val();
      if(con == ''){
          alert('内容不能为空');
          return false;
      }
      $('#com').submit();
  });
  </script>
</body>
</html>
<include file="Index:footer"/>